#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

vector<int> now;
int n;

void print()
{
    for(auto e: now)
        cout << e << ' ';
    cout << endl;
}

void dfs(int x)
{
    print();
    for(int i = x; i <= n; ++i)
    {
        now.push_back(i);
        dfs(i + 1);
        now.pop_back();
    }
}


int main()
{
    cin >> n;
    dfs(1);
    return 0;
}